﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Painel_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void hlkLogin_Click(object sender, EventArgs e)
    {
        OperadorDAL obj = new OperadorDAL();
        Boolean valida = obj.Valida(txtLogin.Text, txtSenha.Text);

        if (valida)
        {
            Session["Logado"] = "Painel";
            Session["idOperador"] = obj.idOperador.ToString();
            Response.Redirect("Default.aspx");
        }
        else
        {
            lblErro.Visible = true;
        }
    }
}